#ifndef LEGS_H

#define LEGS_H

// Code to control MIAU's legs

#include <avr/io.h>

// Position of leg part
#define UPPER 0
#define LOWER 1
#define FRONT 0
#define BACK 1
#define LEFT 0
#define RIGHT 1
// Positions to move servos relative to center position
#define SERVO_FORWARD 200
#define SERVO_CENTER 0
#define SERVO_BACK -200

/*! Moves part of a leg to a specific position
* @param leg_comp array of size 3 with the location of the leg part
* @param pos position to which to move the part's servo
*/
void move_leg_part(int* leg_part, int pos, int duration);

void center_all_legs();

void walk();

void execute_command(char* command);

char read_byte(void);

void read_command(char* command);

void rprintf_str(char* str);

#endif
